package com.edu.admin.entity;


import java.util.List;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;

import com.edu.admin.common.BaseEntity;

/**
 * 地区表实体
 * 
 * @author Wangjiong
 * 
 */
@Table(name = "sys_district")
public class SysDistrict extends BaseEntity{ 

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7117512350084649411L;
	/**
	 * 地区编码
	 * 
	 */
	@Id
	@NotBlank(message = "地区编码不能为空")
	private Long code;
	/**
	 * 地区名称
	 * 
	 */
	@NotBlank(message = "地区名称不能为空")
	private String name;
	/**
	 * 层级
	 * 
	 */
	@NotBlank(message = "地区层级不能为空")
	private Integer level;
	/**
	 * 父级地区编码
	 * 
	 */
	@NotBlank(message = "父级地区编码不能为空")
	private String parentcode;
	/**
	 * 子地区列表
	 * 
	 */
	@Transient
    private List<SysDistrict> sonDistrictList;
    
	public Long getCode() {
		return code;
	}
	public void setCode(Long code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}
	public String getParentcode() {
		return parentcode;
	}
	public void setParentcode(String parentcode) {
		this.parentcode = parentcode;
	}
	public List<SysDistrict> getSonDistrictList() {
		return sonDistrictList;
	}
	public void setSonDistrictList(List<SysDistrict> sonDistrictList) {
		this.sonDistrictList = sonDistrictList;
	}
	
	

	

}
